//---------------------------------------------------------------------------

#ifndef CustomersH
#define CustomersH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Grids.hpp>
#include <Db.hpp>
#include <DBTables.hpp>
#include <DBGrids.hpp>
#include <ComCtrls.hpp>
#include <ToolWin.hpp>
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include "CustomerBridge.h"
#include <DB.hpp>

//---------------------------------------------------------------------------
class TfrmCustomers : public TForm
{
__published:	// IDE-managed Components
        TTable *tblCustomers;
        TDataSource *srcCustomers;
        TTable *tblCheckings;
        TDataSource *srcCheckings;
        TEdit *edtName;
        TButton *btnFind;
        TButton *btnClear;
        TPanel *pnlMain;
        TToolBar *barMain;
        TToolButton *btnUpdate;
        TToolButton *btnAdd;
        TToolButton *btnDelete;
        TDBGrid *grdCustomers;
        TLabel *lblCheckings;
        TLabel *lblName;
        TDBGrid *grdCheckings;
        TBitBtn *btnClose;
        TBitBtn *btnHelp;
        TToolButton *ToolButton1;
        TToolButton *btnReport;
        TToolButton *btnPurchases;
        TButton *btnFindByLastName;
        TButton *btnFindByID;
        void __fastcall btnFindClick(TObject *Sender);
        void __fastcall btnUpdateClick(TObject *Sender);
        void __fastcall btnAddClick(TObject *Sender);
        void __fastcall btnDeleteClick(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall srcCustomersDataChange(TObject *Sender,
          TField *Field);
        void __fastcall btnCloseClick(TObject *Sender);
        void __fastcall FormShow(TObject *Sender);
        void __fastcall btnClearClick(TObject *Sender);
        void __fastcall btnReportClick(TObject *Sender);
        void __fastcall grdCustomersKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
        void __fastcall grdCheckingsDrawColumnCell(TObject *Sender,
          const TRect &Rect, int DataCol, TColumn *Column,
          TGridDrawState State);
        void __fastcall btnPurchasesClick(TObject *Sender);
        void __fastcall btnFindByLastNameClick(TObject *Sender);
        void __fastcall btnFindByIDClick(TObject *Sender);
private:	// User declarations
        TDatabase * dbsMain;
        TCustomerBridge * bridge;
        
        void SetButtonsState();
public:		// User declarations
        __fastcall TfrmCustomers(TComponent* Owner, TDatabase * dbMain);
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmCustomers *frmCustomers;
//---------------------------------------------------------------------------
#endif
